home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / wg_lib / arryctlf.frm < prev    next >
Text File  |  1995-09-06  |  7KB  |  249 lines

  1. VERSION 2.00
  2. Begin Form ArryCtlFrm 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Fast Control Array Operations"
  5.    ClientHeight    =   4470
  6.    ClientLeft      =   1185
  7.    ClientTop       =   1590
  8.    ClientWidth     =   7470
  9.    Height          =   4875
  10.    Left            =   1125
  11.    LinkMode        =   1  'Source
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   4470
  14.    ScaleWidth      =   7470
  15.    Top             =   1245
  16.    Width           =   7590
  17.    Begin CommandButton TestCmd 
  18.       Caption         =   "Test"
  19.       Height          =   435
  20.       Left            =   5475
  21.       TabIndex        =   13
  22.       Top             =   3180
  23.       Width           =   1110
  24.    End
  25.    Begin Frame VFrame 
  26.       BackColor       =   &H00C0C0C0&
  27.       Height          =   1590
  28.       Left            =   255
  29.       TabIndex        =   6
  30.       Top             =   2580
  31.       Width           =   4545
  32.       Begin ListBox VList 
  33.          BackColor       =   &H00C0C0C0&
  34.          Height          =   810
  35.          Left            =   165
  36.          TabIndex        =   8
  37.          Top             =   660
  38.          Visible         =   0   'False
  39.          Width           =   1950
  40.       End
  41.       Begin TextBox Vres 
  42.          Height          =   555
  43.          Left            =   2535
  44.          MultiLine       =   -1  'True
  45.          TabIndex        =   9
  46.          Top             =   585
  47.          Width           =   1590
  48.       End
  49.       Begin ComboBox VCombo 
  50.          BackColor       =   &H00C0C0C0&
  51.          Height          =   300
  52.          Left            =   210
  53.          TabIndex        =   7
  54.          Top             =   225
  55.          Width           =   1935
  56.       End
  57.    End
  58.    Begin TextBox Msg 
  59.       Height          =   840
  60.       Left            =   5055
  61.       MultiLine       =   -1  'True
  62.       TabIndex        =   14
  63.       Top             =   2010
  64.       Width           =   2130
  65.    End
  66.    Begin Frame Cframe 
  67.       BackColor       =   &H00C0C0C0&
  68.       Height          =   885
  69.       Left            =   5145
  70.       TabIndex        =   10
  71.       Top             =   615
  72.       Width           =   1995
  73.       Begin OptionButton CtlOpt 
  74.          BackColor       =   &H00C0C0C0&
  75.          Caption         =   "List Control"
  76.          Height          =   285
  77.          Index           =   2
  78.          Left            =   195
  79.          TabIndex        =   12
  80.          Top             =   510
  81.          Width           =   1545
  82.       End
  83.       Begin OptionButton CtlOpt 
  84.          BackColor       =   &H00C0C0C0&
  85.          Caption         =   "Combo Control"
  86.          Height          =   330
  87.          Index           =   1
  88.          Left            =   180
  89.          TabIndex        =   11
  90.          Top             =   195
  91.          Value           =   -1  'True
  92.          Width           =   1575
  93.       End
  94.    End
  95.    Begin Frame IFrame 
  96.       BackColor       =   &H00C0C0C0&
  97.       Height          =   1590
  98.       Left            =   240
  99.       TabIndex        =   0
  100.       Top             =   480
  101.       Width           =   4500
  102.       Begin ListBox IList 
  103.          BackColor       =   &H00C0C0C0&
  104.          Height          =   810
  105.          Left            =   195
  106.          TabIndex        =   3
  107.          Top             =   660
  108.          Visible         =   0   'False
  109.          Width           =   1935
  110.       End
  111.       Begin TextBox IRes 
  112.          BackColor       =   &H00FFFFFF&
  113.          Height          =   555
  114.          Left            =   2475
  115.          MultiLine       =   -1  'True
  116.          TabIndex        =   4
  117.          Top             =   555
  118.          Width           =   1605
  119.       End
  120.       Begin ComboBox ICombo 
  121.          BackColor       =   &H00C0C0C0&
  122.          Height          =   300
  123.          Left            =   180
  124.          TabIndex        =   2
  125.          Top             =   210
  126.          Width           =   1935
  127.       End
  128.    End
  129.    Begin Label Label2 
  130.       BackColor       =   &H00C0C0C0&
  131.       Caption         =   "VB Operations"
  132.       Height          =   285
  133.       Left            =   285
  134.       TabIndex        =   5
  135.       Top             =   2340
  136.       Width           =   1455
  137.    End
  138.    Begin Label Label1 
  139.       BackColor       =   &H00C0C0C0&
  140.       Caption         =   " WGlib Operations"
  141.       Height          =   255
  142.       Left            =   255
  143.       TabIndex        =   1
  144.       Top             =   195
  145.       Width           =   1680
  146.    End
  147. End
  148. DefInt A-Z
  149.  
  150. Dim Arry() As String
  151.  
  152. Sub CtlOpt_Click (Index As Integer)
  153.     If Index = 2 Then
  154.         CBClearList ICombo
  155.         CBClearList VCombo
  156.         VCombo.visible = 0
  157.         ICombo.visible = 0
  158.         VList.visible = 1
  159.         IList.visible = 1
  160.     Else
  161.         Call LBClearList(IList)
  162.         Call LBClearList(VList)
  163.         VList.visible = 0
  164.         IList.visible = 0
  165.         VCombo.visible = 1
  166.         ICombo.visible = 1
  167.     End If
  168.     Ires.text = ""
  169.     Vres.text = ""
  170. End Sub
  171.  
  172. Sub Form_Load ()
  173.     ' init the array now
  174.     ReDim Arry$(1 To 2500)
  175.     screen.mousepointer = 11
  176.     For x = 1 To UBound(Arry$)
  177.         Arry$(x) = "Element " + Str$(x)
  178.     Next x
  179.     screen.mousepointer = 0
  180. End Sub
  181.  
  182. Sub Form_Paint ()
  183.     ConvexFrm ArryCtlFrm, 4
  184.     ConcaveCtl Ires, 3
  185.     ConcaveCtl Vres, 3
  186.  
  187.     ConvexCtl CFrame, 3
  188.     
  189.     ConcaveCtl Msg, 4
  190. End Sub
  191.  
  192. Sub TestCmd_Click ()
  193.  
  194.     Ires.text = ""
  195.     Vres.text = ""
  196.     Msg.text = ""
  197.     If CtlOpt(1).value Then         ' Combo
  198.        Call CBClearList(VCombo)
  199.        CBClearList ICombo
  200.  
  201.          Msg.text = "Doing VB test"
  202.          screen.mousepointer = 11
  203.          vs! = Timer
  204.          For x = 1 To UBound(Arry$)
  205.             VCombo.AddItem Arry$(x)
  206.          Next x
  207.          vel! = Timer - vs!
  208.          screen.mousepointer = 0
  209.          Vres.text = "Complete.         Time: " + Format$(vel!) + " secs"
  210.          'errc = CBShowList(VCombo)
  211.          VCombo.ListIndex = 0
  212.  
  213.          VCombo.Refresh
  214.          Msg.text = "Doing Our test"
  215.          ws! = Timer
  216.          ArrayToCombo ICombo, Arry$(1), UBound(Arry$)
  217.          wel! = Timer - ws!
  218.  
  219.          Ires.text = "Complete.         Time: " + Format$(wel!)
  220.          'errc = CBShowList(ICombo)
  221.          ICombo.ListIndex = 0
  222.          ICombo.Refresh
  223.  
  224.     Else
  225.        LBClearList VList
  226.        LBClearList IList
  227.  
  228.          Msg.text = "Doing VB test"
  229.          screen.mousepointer = 11
  230.          vs! = Timer
  231.          For x = 1 To UBound(Arry$)
  232.             VList.AddItem Arry$(x)
  233.          Next x
  234.          vel! = Timer - vs!
  235.          screen.mousepointer = 0
  236.          Vres.text = "Complete.         Time: " + Format$(vel!) + " secs"
  237.  
  238.  
  239.          Msg.text = "Doing Our test"
  240.          ws! = Timer
  241.          ArrayToList IList, Arry$(1), UBound(Arry$)
  242.          wel! = Timer - ws!
  243.  
  244.          Ires.text = "Complete.         Time: " + Format$(wel!)
  245.     End If
  246.     Msg.text = "The Complementary operations of Ctl->Array are equally as fast!"
  247. End Sub
  248.  
  249.